home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / bindings / mtool.keys < prev    next >
Encoding:
Text File  |  1996-09-27  |  13.5 KB  |  423 lines

  1. {{{  Comments for this keybinding
  2. ; These keybindings are my variant of the mtool-sun-installation for  the
  3. ; Origami folding editor.
  4. ;
  5. ; It works in general like the mtool-system, but the  special  codes  for
  6. ; find/replace/attach  are  different.   Also   there   are   some  other
  7. ; differences, which are nessessary to use the new commands.
  8. ;
  9. ; The alias-fold includes the binding of the Rx-Keys, so that you can use
  10. ; $Rx to bind them to functions. Every function key should be defined  in
  11. ; this way, because escape sequences are hard to read if you want to  get
  12. ; user-help from the binding-file.
  13. ;
  14. ; Wolfgang Stumvoll
  15. }}}
  16. (defusermacros 10)
  17. {{{  I call these bindings MTool
  18. (defbinding MTool-Sun)
  19. }}}
  20. {{{  Alias for SUN-Keyboard (sunview and console)
  21. ; The following aliases describe the sunview-standard-keymapping for
  22. ; the Rxx-Keys and the Ins-Key.
  23. {{{  Rxx
  24. (alias R1  ($esc  "[ "2 "0 "8 "z))
  25. (alias R2  ($esc "[ "2 "0 "9 "z))
  26. (alias R3  ($esc "[ "2 "1 "0 "z))
  27. (alias R4  ($esc "[ "2 "1 "1 "z))
  28. (alias R5  ($esc "[ "2 "1 "2 "z))
  29. (alias R6  ($esc "[ "2 "1 "3 "z))
  30. (alias R7  ($esc "[ "2 "1 "4 "z))
  31. (alias R8  ($esc "[ "A))
  32. (alias R9  ($esc "[ "2 "1 "6 "z))
  33. (alias R10 ($esc "[ "D))
  34. (alias R11 ($esc "[ "2 "1 "8 "z))
  35. (alias R12 ($esc "[ "C))
  36. (alias R13 ($esc "[ "2 "2 "0 "z))
  37. (alias R14 ($esc "[ "B))
  38. (alias R15 ($esc "[ "2 "2 "2 "z))
  39. }}}
  40. (alias Ins ($esc "[ "2 "4 "7 "z))
  41. }}}
  42. {{{  definition of backspace,rubout
  43. (alias rubout (C-?))
  44. (alias backspace (C-H))
  45. }}}
  46. {{{  marktypes
  47. {{{  pascal
  48. (defmark pascal ( ("< "< "<)
  49.                   (". ". ".)
  50.                   (": ": ":)
  51.                   ("> "> ">)
  52.                 )
  53. )
  54. }}}
  55. {{{  script
  56. (defmark script  ( ("# "# "@)
  57.                    (". ". ".)
  58.                    ("# "# ":)
  59.                    ("# "# "$)
  60.                  )
  61. )
  62. }}}
  63. }}}
  64. {{{  OCL-macros
  65. @lib exit
  66. @lib delchar
  67. @if-using (MOUSY)
  68.    @lib go-mouse
  69.    {{{  go-mouse
  70.    ( deffun go-mouse
  71.       ( if in-prompt
  72.          ( newline-and-indent )
  73.         else
  74.          ( go-mouse-position )
  75.         fi
  76.       )
  77.    )
  78.    }}}
  79.    {{{  go-and-open-mouse
  80.    ( deffun go-and-open-mouse
  81.       ( if in-prompt
  82.          ( newline-and-indent )
  83.         else
  84.          ( go-mouse-position
  85.            case
  86.             ( test-fold-line ( open-fold ) )
  87.             ( test-filed ( enter-fold ) )
  88.            esac
  89.          )
  90.         fi
  91.       )
  92.    )
  93.    }}}
  94.    {{{  go-and-close-mouse
  95.    ( deffun go-and-close-mouse
  96.       ( if in-prompt
  97.          ( newline-and-indent )
  98.         else
  99.          ( go-mouse-position
  100.            close-fold
  101.            if last-message M_TOP ( exit-fold ) fi
  102.          )
  103.         fi
  104.       )
  105.    )
  106.    }}}
  107. @fi
  108. @lib trans-char
  109. @lib wordmacs
  110. @lib mt-fold
  111. {{{  real-enter
  112. (deffun enter-fold- (
  113.   if test-text ( message-exit ( "[ M_NO_SIMPLE_FOLD "] ) ) fi
  114.   enter-fold
  115. ))
  116. }}}
  117. @lib delspaces
  118. {{{  @lib tab
  119. {{{  comments
  120. ; This macro simulates tab-keys (using spaces to go to next position!)
  121. ; you can define 4 tab-width in the following way:
  122. ;   tab-width  /tab-count:   the first tab-count jumps use tab-width
  123. ;   tab-width-1/tab-count-1: the next tab-count-1 jumps use tab-width-1
  124. ;   tab-width-2/tab-count-2: the next tab-count-2 jumps use tab-width-2
  125. ;   tab-width-3:             this is the width for all following jumps
  126. ; negative values for counts have the effect, that the corresponding
  127. ; width-values are use for all following jumps.
  128. ;
  129. ; for example:
  130. ;
  131. ;* the startup-values are:
  132. ;    tab-width 1
  133. ;    tab-count -1
  134. ;  these values let tab have the same effect as space
  135. ;
  136. ;* given the values:
  137. ;    tab-width=2     tab-count=1
  138. ;    tab-width-1=3   tab-count-1=2
  139. ;    tab-width-2=4   tab-count-2=2
  140. ;    tab-width-3=5
  141. ;
  142. ;  the resulting tab-positions are:
  143. ;
  144. ;  a b  c  d   e   f    g    h    i    j    k    l    m
  145. ;  ^ ^  ^  ^   ^   ^    ^    ^    ^    ^    ^    ^    ^
  146. ;  | |  |  |   |   |    all following jumps use tab-width-3
  147. ;  | |  |  |   |   |
  148. ;  | |  |  |   tab-width-2-jumps
  149. ;  | |  |  |
  150. ;  | |  tab-width-1-jumps
  151. ;  | |
  152. ;  | tab-width-jump
  153. ;  |
  154. ;  first character in line
  155. }}}
  156. @if-using not(TAB)
  157.   @use (TAB)
  158.   {{{  vars
  159.   ( defvar
  160.      ( tab-width          ; first tab-step
  161.        tab-count          ; number of usages for ^, <0 -> always
  162.        tab-width-1        ; second tab-step
  163.        tab-count-1        ; number of usages of step 2
  164.        tab-width-2        ; third tab-step
  165.        tab-count-2        ; number of usages of step 3
  166.        tab-width-3        ; last tab-step
  167.        tab-missing-spaces ; help-counter
  168.      )
  169.   )
  170.   }}}
  171.   {{{  go_to_next_tab
  172.   (deffun go_to_next_tab (
  173.     if in-prompt ( return-from-macro ) fi
  174.     {{{  maybe initialise the counter for tab-width
  175.     if <=(tab-width 0) ( set tab-width 0 ) fi
  176.     }}}
  177.     if =(tab-width 0)
  178.      ( insert-ascii 9 return-from-macro )
  179.     fi
  180.     {{{  tab-missing-spaces = #missing `` ''
  181.     set tab-missing-spaces -(1 +(store-pos set-space-enter))
  182.     local (tab-count tab-count-1 tab-count-2) (
  183.       do (
  184.         case
  185.           ( tab-count
  186.              ( set tab-missing-spaces +(tab-missing-spaces tab-width  )
  187.                set tab-count  +(tab-count   -1)
  188.              )
  189.           )
  190.           ( tab-count-1
  191.              ( set tab-missing-spaces +(tab-missing-spaces tab-width-1)
  192.                set tab-count-1 +(tab-count-1 -1)
  193.              )
  194.           )
  195.           ( tab-count-2
  196.              ( set tab-missing-spaces +(tab-missing-spaces tab-width-2)
  197.                set tab-count-2 +(tab-count-2 -1)
  198.              )
  199.           )
  200.         default
  201.           (set tab-missing-spaces +(tab-missing-spaces tab-width-3))
  202.         esac
  203.       ) while <=(tab-missing-spaces 0)
  204.     )
  205.     }}}
  206.     {{{  insert the spaces
  207.     do
  208.      ( "  ;
  209.        set tab-missing-spaces +(tab-missing-spaces -1)
  210.      )
  211.     while <>(tab-missing-spaces 0)
  212.     }}}
  213.   ))
  214.   }}}
  215.   {{{  define-tab
  216.   (deffun define-tab (
  217.     if in-prompt ( return-from-macro ) fi
  218.     prompt-counter tab-width ("Tab "  "size "  "? )
  219.     set tab-count -1
  220.   ))
  221.   }}}
  222.   {{{  undeclare
  223.   ( undeclare ( tab-missing-spaces ) )
  224.   }}}
  225. @fi
  226. }}}
  227. @lib append
  228. @lib go-match
  229. @lib np-file
  230. }}}
  231. {{{  folding
  232. (keybind toggle-attach-file-to-fold ($esc "a "t))
  233. (keybind create-fold               ($R15))
  234. (keybind create-fold               ($esc "c "r))
  235. (keybind auto-header               ($esc "f "h))
  236. (keybind describe-fold             ($esc "f "?))
  237. (keybind enter-fold-               ($R13 $R4))
  238. (keybind enter-fold-               ($esc "e "n))
  239. (keybind enter-fold-               (M-C-O))
  240. (keybind exit-fold                 ($R13 $R6))
  241. (keybind exit-fold                 ($esc "e "x))
  242. (keybind exit-fold                 (M-C-C))
  243. (keybind close-fold                ($R6))
  244. (keybind close-fold                ($esc "c "l))
  245. (keybind close-fold                (C-C))
  246. (keybind toggle-file-fold          ($R13 $R11))
  247. (keybind toggle-file-fold          ($esc "f "f))
  248. (keybind open-fold                 ($esc "o "p))
  249. (keybind open-fold                 ($R4))
  250. (keybind open-fold                 (C-O))
  251. (keybind unfold-fold               ($esc "r "e))
  252. (keybind unfold-fold               ($R13 $R15))
  253. }}}
  254. {{{  moving around
  255. (keybind end-of-fold               ($R3))
  256. (keybind end-of-fold               ($esc "b "O))
  257. (keybind next-line                 ($R14))
  258. (keybind next-line                 ($esc "d "n))
  259. (keybind next-line                 (C-N))
  260. (keybind end-of-line               ($R9))
  261. (keybind end-of-line               ($esc "e "l))
  262. (keybind goto-line                 ($esc "g "o))
  263. (keybind goto-line                 ($R13 "g))
  264. (keybind backward-character        ($esc "l "e))
  265. (keybind backward-character        ($R10))
  266. (keybind backward-character        (C-B))
  267. (keybind next-page                 ($esc "p "d))
  268. (keybind next-page                 ($R13 $R3))
  269. (keybind previous-page             ($esc "p "u))
  270. (keybind previous-page             ($R13 $R1))
  271. (keybind forward-character         ($esc "r "i))
  272. (keybind forward-character         ($R12))
  273. (keybind forward-character         (C-F))
  274. (keybind beginning-of-line         ($R7))
  275. (keybind beginning-of-line         ($esc "s "l))
  276. (keybind beginning-of-fold         ($esc "s "F))
  277. (keybind beginning-of-fold         ($R1))
  278. (keybind previous-line             ($esc "u "p))
  279. (keybind previous-line             ($R8))
  280. (keybind previous-line             (C-P))
  281. (keybind backward-word             ($esc "l "w))
  282. (keybind backward-word             ($R13 $R10))
  283. (keybind forward-word              ($esc "r "w))
  284. (keybind forward-word              ($R13 $R12))
  285. (keybind mtool-top                 ($esc "s "f))
  286. (keybind mtool-top                 ($R13 $R8))
  287. (keybind mtool-bot                 ($esc "b "o))
  288. (keybind mtool-bot                 ($R13 $R14))
  289. (keybind goto-matching-fence       ($esc "]))
  290. }}}
  291. {{{  editing
  292. (keybind double-line               ($R13 $R5))
  293. (keybind double-line               ($esc "c "o))
  294. (keybind copy-to-kill-buffer       ($R5))
  295. (keybind copy-to-kill-buffer       ($esc "c "p))
  296. (keybind move-line                 ($esc "m "o))
  297. (keybind move-line                 ($R13 $R2))
  298. (keybind kill-line                 ($esc "p "i))
  299. (keybind kill-line                 ($R2))
  300. (keybind insert-folded-kill-buffer ($esc "p "p))
  301. (keybind insert-folded-kill-buffer ($R11))
  302. (keybind newline-and-indent        (C-M))
  303. (keybind case-word-capitalize      (C-W))
  304. (keybind case-word-lower           (C-L))
  305. (keybind case-word-upper           (C-U))
  306. (keybind go_to_next_tab            (C-I))
  307. (keybind transpose-characters      (C-T))
  308. }}}
  309. {{{  macros
  310. (keybind save-keyboard-macro       ($esc "d "f))
  311. (keybind define-macro              ($esc "d "m))
  312. (keybind define-macro              ($R13 "d "m))
  313. (keybind execute-macro             ($esc "c "m))
  314. (keybind execute-macro             ($R13 "m))
  315. (keybind execute-number-macro 1    ($esc "m "1))
  316. (keybind execute-number-macro 2    ($esc "m "2))
  317. (keybind execute-number-macro 3    ($esc "m "3))
  318. (keybind execute-number-macro 4    ($esc "m "4))
  319. (keybind execute-number-macro 5    ($esc "m "5))
  320. (keybind execute-number-macro 6    ($esc "m "6))
  321. (keybind execute-number-macro 7    ($esc "m "7))
  322. (keybind execute-number-macro 8    ($esc "m "8))
  323. (keybind execute-number-macro 9    ($esc "m "9))
  324. }}}
  325. {{{  deletes
  326. (keybind delete-previous-character (C-H))
  327. (keybind delete-character          (C-?))
  328. (keybind delete-line               ($R13 $R9))
  329. (keybind delete-line               ($esc "d "l))
  330. (keybind delete-to-end-of-line     ($esc "d "e))
  331. (keybind undo-delete-character     ($esc "u "c))
  332. (keybind undo-delete-line          ($esc "u "l))
  333. (keybind delspaces                 ($esc C-?))
  334. (keybind append-to-previous-line   ($esc C-H))
  335. }}}
  336. {{{  finds
  337. (keybind search-forward            ($esc "f "i))
  338. (keybind search-reverse            ($esc "f "r))
  339. (keybind incremental-search-forward($esc "i "s))
  340. (keybind incremental-search-forward($R13 "f))
  341. (keybind query-replace-string      ($esc "r "p))
  342. (keybind query-replace-string      ($R13 "r))
  343. }}}
  344. {{{  specials
  345. (keybind help                      ($esc "h "e))
  346. (keybind help                      ($R13 "h))
  347. (keybind redraw-display            ($esc $esc))
  348. (keybind redraw-display            ($R13 $R13))
  349. (keybind abort                     (C-\))
  350. (keybind describe-bindings         ($R13 "?))
  351. (keybind describe-bindings         ($esc "h "b))
  352. (keybind quote-character           (C-Q))
  353. }}}
  354. {{{  shells/filter
  355. (keybind save-and-exit-origami     ($esc "f "n))
  356. (keybind shell                     ($esc "s "h))
  357. (keybind exit-origami              ($esc "q "u))
  358. (keybind exit-origami              ($R13 "q))
  359. (keybind filter-buffer             ($esc "f "b))
  360. (keybind pipe-from-command         ($esc "< "p))
  361. (keybind pipe-to-command           ($esc "> "p))
  362. (keybind shell-command             ($esc "s "c))
  363. (keybind suspend-origami           (C-S))
  364. }}}
  365. {{{  files
  366. (keybind insert-file               ($esc "i "n))
  367. (keybind insert-file               ($R13 "i))
  368. (keybind read-file                 ($esc "o "f))
  369. (keybind read-file                 ($R13 "o))
  370. (keybind save-file                 ($esc "s "a))
  371. (keybind save-file                 ($R13 "s))
  372. (keybind next-file                 ($esc "n "f))
  373. (keybind previous-file             ($esc "p "f))
  374. (keybind write-file                ($esc "w "f))
  375. (keybind write-file                ($R13 "w))
  376. }}}
  377. {{{  modes
  378. (keybind set-language              ($esc "l "a))
  379. (keybind set-language              ($R13 "l))
  380. (keybind add-mode-autosave         ($esc "+ "a))
  381. (keybind add-mode-echo             ($esc "+ "e))
  382. (keybind add-mode-overwrite        ($esc "+ "o))
  383. (keybind add-mode-overwrite        ($R13 $Ins))
  384. (keybind add-mode-view             ($esc "+ "v))
  385. (keybind delete-mode-autosave      ($esc "- "a))
  386. (keybind delete-mode-echo          ($esc "- "e))
  387. (keybind delete-mode-overwrite     ($esc "- "o))
  388. (keybind delete-mode-overwrite     ($Ins))
  389. (keybind delete-mode-view          ($esc "- "v))
  390. (keybind define-tab                ($esc C-I))
  391. }}}
  392. {{{  arguments
  393. (keybind set-argument-0            ($esc "0))
  394. (keybind set-argument-0            ($R13 "0))
  395. (keybind set-argument-1            ($esc "1))
  396. (keybind set-argument-1            ($R13 "1))
  397. (keybind set-argument-2            ($esc "2))
  398. (keybind set-argument-2            ($R13 "2))
  399. (keybind set-argument-3            ($esc "3))
  400. (keybind set-argument-3            ($R13 "3))
  401. (keybind set-argument-4            ($esc "4))
  402. (keybind set-argument-4            ($R13 "4))
  403. (keybind set-argument-5            ($esc "5))
  404. (keybind set-argument-5            ($R13 "5))
  405. (keybind set-argument-6            ($esc "6))
  406. (keybind set-argument-6            ($R13 "6))
  407. (keybind set-argument-7            ($esc "7))
  408. (keybind set-argument-7            ($R13 "7))
  409. (keybind set-argument-8            ($esc "8))
  410. (keybind set-argument-8            ($R13 "8))
  411. (keybind set-argument-9            ($esc "9))
  412. (keybind set-argument-9            ($R13 "9))
  413. }}}
  414. {{{  mouse
  415. @if-using (MOUSY)
  416.    ( mouse-buttons
  417.         go-mouse
  418.         go-and-open-mouse
  419.         go-and-close-mouse
  420.    )
  421. @fi
  422. }}}
  423.